package com.yifei.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.yifei.base.IBaseEnum;
import lombok.Getter;

/**
 * @Description: 记录日志操作类型
 * @Author: yiFei
 * @date: 2023/11/1 15:11
 */
public enum BusinessTypeEnum implements IBaseEnum<Integer> {

    OTHER(0, "其他"),
    INSERT(1, "新增"),
    UPDATE(2, "修改"),
    DELETE(3, "删除"),
    EXPORT(4, "导出"),
    IMPORT(5, "导入"),
    UPLOAD(6, "上传文件"),
    LOGIN(9, "登录"),
    LOGOUT(10, "退出"),
    TEST(999, "测试");

    @Getter
    @EnumValue //  Mybatis-Plus 提供注解表示插入数据库时插入该值
    private Integer value;

    @Getter
    @JsonValue //  表示对枚举序列化时返回此字段
    private String label;

    BusinessTypeEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }
}
